1. Field of the Invention
The invention relates to a data storage system and a managing method thereof, especially for the data storage system specified in RAID architecture. Moreover, in particular, the data storage system according to the invention includes a backup memory for preventing from loss of data to be written and for protecting the data to be written once the data storage system suffers from power failure.
2. Description of the Prior Art
With more and more amount of user data stored as demanded, Redundant Array of Independent Drives (RAID) systems have been widely used to store a large amount of digital data. RAID systems are able to provide high availability, high performance, or high volume of data storage volume for hosts.
The RAID system utilizes various technologies known as RAID levels, and also to be divided into RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5, and RAID 6. Each RAID level of technology has its own advantages and disadvantages.
Constitution of the well-known RAID system includes a RAID controller and a RAID composed of a plurality of disk drives. The RAID controller is coupled to each disk drive, and defines the disk drives as one or more logical disk drives selected among RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5, RAID 6, and others.
Referring to FIG. 1, the architecture of a typical data storage system 1 specified in RAID 5 architecture is illustratively shown in FIG. 1. The data storage system 1 includes a plurality of storage devices 12 and a controller 10.
In one embodiment, the storage devices 12 are specified in a RAID architecture such as RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5, RAID 6, and so on.
The controller 10 is capable of generating (reconstructing) redundant data which are identical to data to be read. For example, in RAID 5 architecture, the controller 10 generates redundant data by Exclusive OR (XOR) operation.
In practical application, each of the storage devices 12 can be a tape drive, a disk drive, a memory device, an optical storage drive, a sector corresponding to a single read-write head in the same disk drive, or other equivalent storage devices.
Also as shown in FIG. 1, the controller 10 is respectively coupled to each of the storage devices 12. FIG. 1 also illustratively shows an application I/O request unit 2. The application I/O request unit 2 is coupled to the controller 10 through a transmission interface 14. In practical application, the application I/O request unit 2 can be a network computer, a mini-computer, a mainframe, a notebook computer, or any electronic equipment need to read or write data in the data storage system 1, e.g., a cell phone, a personal digital assistant (PDA), a digital recording apparatus, a digital music player, and so on.
When the application I/O request unit 2 is a stand-alone electronic equipment, it can be coupled to the data storage system 1 through a transmission interface such as a storage area network (SAN), a local area network (LAN), a serial ATA (SATA) interface, a fiber channel (FC), a small computer system interface (SCSI), and so on, or other I/O interfaces such as a PCI express interface. In addition, when the application I/O request unit 2 is a specific integrated circuit device or other equivalent devices capable of transmitting I/O read or write requests, it can send read or write requests to the controller 10 according to commands (or requests) from other devices, and then read or write data in the storage devices 12 via the controller 10.
The controller 10 and the storage devices 12 of the data storage system 1 can not only be installed in an enclosure, but also be separately installed in different enclosures. In practical application, the controller 10 can be coupled to the data storage devices 12 through transmission interfaces such as FC, SCSI, SAS, SATA, PATA, and so on. If the data storage devices 12 are disk drives, each of data storage devices 12 can be a disk drive of different interface such as FC, SCSI, SAS, SATA, PATA, and so on. The controller 10 can be a RAID controller or a controller capable of generating redundant data for the data storage system 1.
Also as shown in FIG. 1, each of the storage devices 12 includes a respective write cache 122. Each of the storage devices 12 can be divided into a plurality of blocks. On the viewpoint of fault tolerance, the plurality of blocks can be classified into two kinds of blocks which are the target data blocks and the parity data blocks. The target data blocks store general user data. The parity data blocks store the remaining parity data to provide to calculate the user data when the fault tolerant is required. The corresponding target data blocks and the parity data block in different data storage devices form a stripe, where data in the parity data block are a result of Exclusive OR (XOR) operation executed on the data in the target data blocks. It is noticed that those of ordinary skill in the art all understand the calculation of the data in the parity data blocks can also be executed by, other than Exclusive or (XOR) operation, various parity operations or similar operations which just have the relationship that data of any block can be obtained by calculating data of corresponding blocks in the same stripe.
If data at user side are to be written into the data storage system 1, the controller 10 receives data transmitted from the application I/O request unit 2 through the transmission interface 14. Then, the controller 10 performs a predetermined operation (for example, XOR operation) for the received data to generate data to be written. Afterward, the controller 10 transmitting the data to be written to the write caches 122 of the storage devices 12. After the data to be written are stored in the write cache 122 of the storage devices 12, the storage device 12 responses a writing confirm message to the controller 10. At this time, the controller 10 supposes that the data to be written have been written into the storage devices 12, and then do not protect the data to be written. Nevertheless, total of the data to be written stored in the storage devices 12 uncertainly have been written into media of the storage devices 12. Once the data storage system 1 suffers from non-anticipated power failure, the data to be written still stored in the write caches 122 of the storage devices 12 would be lost.